package com.tsd.jxc.sale.dao;

import com.tsd.common.vo.BatchDeleteLogicVo;
import com.tsd.core.vo.PageBean;
import com.tsd.jxc.sale.entity.JxcSaleOrder;
import com.tsd.jxc.sale.entity.JxcSaleOrderExt;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 描述：JxcSaleOrderMapper
 *
 * @author Hillpool
 * @date 2022/07/29 15:04:33
 */
public interface JxcSaleOrderMapper {

    JxcSaleOrder selectByPrimaryKey(Long id);

    JxcSaleOrderExt selectBySid(String sid);

    int deleteByPrimaryKey(Long id);

    int insert(JxcSaleOrder record);

    int insertSelective(JxcSaleOrder record);

    int insertList(@Param("list") List<JxcSaleOrderExt> list);

    int updateByPrimaryKey(JxcSaleOrder record);

    int updateByPrimaryKeySelective(JxcSaleOrder record);

    int updateList(@Param("list") List<JxcSaleOrderExt> list);

    List<JxcSaleOrderExt> selectByEntity(JxcSaleOrderExt record);

    List<JxcSaleOrderExt> selectByPage(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<JxcSaleOrderExt> selectCount1Page(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<JxcSaleOrderExt> selectByParams(@Param("params") Map<String, Object> params);

    JxcSaleOrderExt selectDuplicatedCode(JxcSaleOrderExt record);

    int deleteLogicBySidList(BatchDeleteLogicVo logicVo);

    int updateReturnInfo(@Param("return_bill_list") List<String> return_bill_list);

    List<JxcSaleOrderExt> selectValid4Return(@Param("list") List<String> list);

    List<JxcSaleOrderExt> selectSaleOrdersIncludeDetailByPage(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    int restoreOutBill(@Param("out_bill_list") List<String> out_bill_list);

    int updateInvoiceState(@Param("invoice_list") List<String> invoice_list, @Param("state") Integer state);

    List<JxcSaleOrderExt> select4CheckStock(@Param("sid_list") List<String> sid_list);

    int countValid(@Param("yyyy") Integer yyyy, @Param("mm") Integer mm, @Param("state") Integer state);

    int countValidByParams(@Param("params") Map<String, Object> params);

    int updateInvoiceAmount(@Param("invoice_list") List<String> invoice_list);

    List<JxcSaleOrderExt> select4CalTax();

    List<JxcSaleOrderExt> selectBySids(@Param("sids") List<String> sids);

    int updateCutAmountBySidList(@Param("sid_list") List<String> sid_list);

    List<JxcSaleOrderExt> selectByBuyOrderSids(@Param("sids") List<String> sids);
}